# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=dnstwist
pkgver=20220131
pkgrel=1
pkgdesc="Domain name permutation engine"
options="!check" # no testsuite
url="https://dnstwist.it"
arch="noarch"
license="Apache-2.0"
depends="python3 py3-requests py3-dnspython py3-tld"
makedepends="py3-setuptools"
subpackages="$pkgname-dictionaries"

source="$pkgname-$pkgver.tar.gz::https://github.com/elceef/dnstwist/archive/$pkgver.tar.gz"

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

dictionaries() {
	pkgdesc="Dictionaries for dnstwist"
	depends=""

	mkdir -p "$subpkgdir"/usr/share/dnstwist/dictionaries
	for dict in "$builddir"/dictionaries/*.dict; do
		install -Dm0644 "$dict" "$subpkgdir"/usr/share/dnstwist/dictionaries/"$(basename $dict)"
	done
}

sha512sums="
fa0d4636e081814bd5e376c349377fbca780afc78e7a97226a14cb86c8be8bd6e1c0681f006fc8cf14625ff8962e5dd7d27bf1162f699c7d135740a48d155a52  dnstwist-20220131.tar.gz
"
